package com.mxl.service.channel.strategy.impl;

import java.util.Map;

import com.mxl.common.StringUtil;
import com.mxl.dao.channel.model.DealRequest;
import com.mxl.service.channel.strategy.ChannelRequestStrategy;
import com.mxl.service.channel.strategy.RequestStrategyFactory;

/**
 * 渠道请求特殊处理
 * 
 * @author xianglin.mo
 * 
 */
public class ChannelRequestStrategyFactory implements RequestStrategyFactory {
	private Map<String, ChannelRequestStrategy> channelRequestStrategyMap;

	/**
	 * 渠道请求特殊处理
	 */
	public void handleRequest(DealRequest request, String cardEncode) {
		ChannelRequestStrategy strategy = channelRequestStrategyMap
				.get(cardEncode);
		if (!StringUtil.isNull(strategy)) {
			strategy.handleRequest(request);
		}
	}

	public void setChannelRequestStrategyMap(
			Map<String, ChannelRequestStrategy> channelRequestStrategyMap) {
		this.channelRequestStrategyMap = channelRequestStrategyMap;
	}

}
